Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Recovery section in the new user settings Encryption tab #28673

Merged
merged 44 commits into from
Jan 15, 2025

Conversation

florianduros
Copy link
Member

@florianduros florianduros commented Dec 6, 2024

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • I have licensed the changes to Element by completing the Contributor License Agreement (CLA)

First of all, I'm sorry for the size of the PR.

Task #26468
Figma design
Add a new encryption tab with a new recovery section.

Implemented

  • Add the crypto team as code owner of this new encryption tab

The encryption tab has the following behaviour:

  • If the encryption is not setup, we display a verify button to launch the Set up encryption dialog. Only this button and his description is displayed. The user must verify his device or set up the encryption before playing with the encryption settings.
  • Otherwise, display the Recovery section (the Key storage and Advanced section in the future)
  • If the user want to set up or change the recovery key when clicking on the corresponding button of the recovery section, the content of the encryption tab is replaced by a breadcrumb to do it.

The recovery section has the following behaviour:

  • If the recovery key is not setup, we ask to setup a recovery key
  • If the secrets (cross-signing keys) are not cached locally, we ask to enter the recovery key
  • Otherwise, display the "change recovery key" button

Not implemented

This PR DON'T (because the PR is already massive and theses tasks should be done in other PRs):

  • Implement the "Key storage is out of sync" toast
  • Implement the new "Enter your recovery key" dialog and the "Forgot your recovery key? You’ll need to reset your identity." dialog
  • Add dot to the User settings tab

@florianduros florianduros force-pushed the florianduros/encryption-tab branch 3 times, most recently from 7ee9a42 to a90f51f Compare December 6, 2024 11:06
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from a90f51f to b3dc812 Compare December 6, 2024 14:19
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from b3dc812 to 98d86e0 Compare December 6, 2024 16:21
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from 98d86e0 to 2710462 Compare December 10, 2024 15:02
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from 2710462 to 5e31204 Compare December 11, 2024 14:30
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from 5e31204 to 54ede8b Compare December 11, 2024 14:49
@florianduros florianduros force-pushed the florianduros/encryption-tab branch from 54ede8b to 1811aa6 Compare December 11, 2024 17:22
@florianduros florianduros force-pushed the florianduros/encryption-tab branch 5 times, most recently from 97b9f95 to 9aecfcc Compare December 12, 2024 09:16
src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
playwright/e2e/settings/encryption-user-tab/index.ts Outdated Show resolved Hide resolved
Comment on lines 33 to 36
* - `save_key_setup_flow`: The user is asked to save the new recovery key during the setup flow.
* - `save_key_change_flow`: The user is asked to save the new recovery key during the change key flow.
* - `confirm`: The user is asked to confirm the new recovery key.
* - `confirm_key_setup_flow`: The user is asked to confirm the new recovery key during the set up flow.
* - `confirm_key_change_flow`: The user is asked to confirm the new recovery key during the change key flow.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to say, I wonder if it wouldn't be simpler to just have three states (inform_user, save_key, confirm_key) and distinguish between the two flows by looking at the userHasRecoveryKey prop.

On the other hand, we should probably just get on and land this rather than messing with it forever. A thought for the future though.

@@ -21,14 +21,17 @@ import { SettingsSubheader } from "../SettingsSubheader";
* - `loading`: We are checking the recovery key and the secrets.
* - `missing_recovery_key`: The user has no recovery key.
* - `secrets_not_cached`: The user has a backup but the secrets are not cached.
* This shouldn't happen but we have seen cases where the secrets gossiping failed or shared partial secrets when verified with another device.
* - `good`: The user has a backup and the secrets are cached.
* This can happen if we verified another device and secret-gossiping failed, or the other device itself lacked the secrets.
Copy link
Member

@richvdh richvdh Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth noting that this indentation is lost if/when the tsdoc is rendered to HTML, and is inconsistent with our style elsewhere.

But, not a big problem. Something to consider for the future.

src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
src/components/views/settings/encryption/RecoveryPanel.tsx Outdated Show resolved Hide resolved
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@florianduros florianduros added this pull request to the merge queue Jan 15, 2025
Merged via the queue into develop with commit 13913ba Jan 15, 2025
31 checks passed
@florianduros florianduros deleted the florianduros/encryption-tab branch January 15, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants